package org.esk.dablog.web.forms.forum;

import org.esk.dablog.web.forms.AddEntryForm;
import org.esk.dablog.web.forms.AbstractAddComment;
import org.esk.dablog.web.util.RequestUtils;
import org.esk.dablog.model.Entry;
import org.esk.dablog.model.Comment;
import org.esk.dablog.model.forum.ForumPostEntry;
import org.esk.dablog.model.forum.ForumTopicEntry;
import org.esk.dablog.exceptions.ParameterException;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.view.RedirectView;
import org.springframework.validation.BindException;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * This class implements "add topic" task
 * User: esk
 * Date: 08.12.2006
 * Time: 20:26:31
 * $Id:$
 */
public class AddCommentForm extends AbstractAddComment {


    protected void processComment(HttpServletRequest request, Comment c) throws Exception {
    }


    protected ModelAndView onSubmit(HttpServletRequest request, HttpServletResponse response, Object command, BindException errors) throws Exception {
        super.onSubmit(request, response,command, errors);
        long entryId = RequestUtils.extractLongParameter(request);
        return new ModelAndView(new RedirectView(getSuccessView() + "/" + entryId, true));        
    }

}
